package demoMod.invincibleOne.cards.invincible;

import basemod.helpers.CardModifierManager;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import demoMod.invincibleOne.InvincibleOneMod;
import demoMod.invincibleOne.enums.AbstractCardEnum;
import demoMod.invincibleOne.enums.CardTagsEnum;
import demoMod.invincibleOne.modifiers.ExhaustAtStartOfCombatMod;
import demoMod.invincibleOne.patches.PreDrawPatch;
import demoMod.invincibleOne.powers.CreamyCursePower;
import demoMod.invincibleOne.powers.DifficultyBreathingPower;
import demoMod.invincibleOne.powers.IndustrialRevolutionPower;
import demoMod.invincibleOne.relics.TaskGoal;

public class CreamyCurse extends AbstractInvincibleCard implements PreDrawPatch.ICardPreDraw {
    public static final String ID = InvincibleOneMod.makeID("CreamyCurse");

    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;
    public static final String IMG_PATH = "cards/CreamyCurse.png";

    private static final CardType TYPE = CardType.SKILL;
    private static final CardRarity RARITY = AbstractCardEnum.LEGENDARY;
    private static final CardTarget TARGET = CardTarget.SELF;

    private static final int COST = -2;

    public CreamyCurse() {
        super(ID, NAME, InvincibleOneMod.getResourcePath(IMG_PATH), COST, DESCRIPTION, TYPE, RARITY, TARGET);
        this.baseMagicNumber = this.magicNumber = 3;
        this.tags.add(CardTagsEnum.ALERT);
    }

    @Override
    public void onPreDraw() {
        TaskGoal.AddToAlertQueue(2, new TaskGoal.AlertLambda() {
            @Override
            public void run() {
                AbstractPlayer p = AbstractDungeon.player;
                addToTop(new ApplyPowerAction(p, p, new CreamyCursePower(p, magicNumber, false)));
            }
        });
    }

    @Override
    public Runnable getUpgradeAction() {
        return () -> upgradeMagicNumber(1);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {

    }
}
